package dtos;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;



public class UsertypeDTO implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -5559069344402795487L;
	private String name;
	private int id;
	private List<Integer> users=new ArrayList<>();
	
	

	public List<Integer> getUsers() {
		return users;
	}

	public void setUsers(List<Integer> users) {
		this.users = users;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void addUser(int user)
	{
		users.add(user);
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UsertypeDTO other = (UsertypeDTO) obj;
		if (id != other.id)
			return false;
		return true;
	}
	
	@Override
	public String toString() {
		return name;
	}
	
	
}
